package flake

import (
	beego "github.com/beego/beego/v2/server/web"
	"github.com/bwmarrin/snowflake"
	"strconv"
)

var nodeId, _ = beego.AppConfig.Int("nodeId")

var Flake, _ = snowflake.NewNode(int64(nodeId))

func GetId() int64 {
	return Flake.Generate().Int64()
}

func GetString() string {
	return strconv.FormatInt(GetId(), 10)
}
